/**
 * 文件描述如下：
 * 1. 设备驱动页面的数据
 */

// 处理交通流量页面的数据

const data_1 = {
  title: '数据保存',
  data: [
    {
      id: 0,
      key: 'm-ss-save-data-path',
      parentNode: null,
      name: '数据保存路径',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 1,
      key: 'm-uc-tracker-data-save',
      parentNode: null,
      name: '多杆融合结果是否保存标志',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 2,
      key: 'm-uc-org-data-save',
      parentNode: null,
      name: '多杆融合输入数据保存标志',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 3,
      key: 'm-uc-org-data-n-m-s-save',
      parentNode: null,
      name: '多杆融合预处理后跟踪前数据保存标志',
      showType: 'switch',
      inputType: 'switch',
    },
  ],
}

const data_2 = {
  title: '输出过滤',
  data: [
    {
      id: 0,
      key: 'use-out-area-deal',
      parentNode: null,
      name: '输出结果区域过滤开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 1,
      key: 'deal-out-path',
      parentNode: null,
      name: '输出结果过滤区域配置文件路径',
      showType: 'input',
      inputType: 'text',
    },
  ],
}

const data_3 = {
  title: '跟踪',
  data: [
    {
      id: 0,
      key: 'bmp-img-path',
      parentNode: null,
      name: '航向角/车道/道路属性配置文件路径',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 1,
      key: 'param-find-angle-path',
      parentNode: null,
      name: 'bmp对应参数文件路径',
      showType: 'input',
      inputType: 'text',
    },
    {
      id: 2,
      key: 'motor-type',
      arr: [],
      parentNode: null,
      name: '机动车类别序号',
      showType: 'text',
      inputType: 'text',
    },
    {
      id: 3,
      key: 'no-motor-type',
      arr: [],
      parentNode: null,
      name: '非机动车类别序号',
      showType: 'text',
      inputType: 'text',
    },
    {
      id: 4,
      key: 'special-no-motor-type',
      arr: [],
      parentNode: null,
      name: '特殊目标类别序号（路锥/抛洒物）',
      showType: 'text',
      inputType: 'text',
    },
    {
      id: 5,
      key: 'det-iou-threshold',
      parentNode: null,
      name: '输入数据去重过程IOU阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 6,
      key: 'trk-iou-threshold',
      parentNode: null,
      name: '跟踪输出数据去重过程IOU阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 7,
      key: 'iou-threshold',
      parentNode: null,
      name: '跟踪中检测-跟踪关联的IOU阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 8,
      key: 'motor-head-threshold',
      parentNode: null,
      name: '跟踪中检测-跟踪关联的距离配置纵向阈值',
      showType: 'input',
      inputType: 'double',
    },
    // motor_ano_threshold
    {
      id: 9,
      key: 'motor-ano-threshold',
      parentNode: null,
      name: '跟踪中检测-跟踪关联的距离配置横向阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 10,
      key: 'no-motor-circle-threshold',
      parentNode: null,
      name: '跟踪中特殊目标类别与其他类别距离值',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 11,
      key: 'no-motor-threshold',
      parentNode: null,
      name: '非机动车跟踪中检测-跟踪关联距离匹配半径阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 12,
      key: 'm-ff-width-coe',
      parentNode: null,
      name: '跟踪中计算IOU时，目标宽度尺寸缩放比例',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 13,
      key: 'm-uc-track-age',
      parentNode: null,
      name: '跟踪器未匹配情况下最长保留帧数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 14,
      key: 'm-uc-track-age-no-motor',
      parentNode: null,
      name: '非机动车跟踪器未匹配情况下最长保留帧数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 15,
      key: 'm-uc-min-hits',
      parentNode: null,
      name: '跟踪器最小击中次数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 16,
      key: 'frame-rate',
      parentNode: null,
      name: '每秒帧数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 17,
      key: 'k-reduce',
      parentNode: null,
      name: '卡尔曼增益缩放因子',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 18,
      key: 'kf-r',
      arr: [],
      parentNode: null,
      name: '测量协方差矩阵',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 19,
      arr: [],
      key: 'kf-q-xy',
      parentNode: null,
      name: '状态噪声协方差矩阵 (x, y)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 20,
      arr: [],
      key: 'kf-q-vxy',
      parentNode: null,
      name: '状态噪声协方差矩阵 (vx, vy)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 21,
      arr: [],
      key: 'kf-q-axy',
      parentNode: null,
      name: '状态噪声协方差矩阵 (ax, ay)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 22,
      arr: [],
      key: 'kf-p-xy',
      parentNode: null,
      name: '误差协方差矩阵 (x, y)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 23,
      arr: [],
      key: 'kf-p-vxy',
      parentNode: null,
      name: '误差协方差矩阵 (vx, vy)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 24,
      arr: [],
      key: 'kf-p-axy',
      parentNode: null,
      name: '误差协方差矩阵 (ax, ay)',
      showType: 'eidtArr',
      inputType: 'text',
    },
    {
      id: 25,
      key: 'kf-speed-thresh',
      parentNode: null,
      name: '高低速目标区分阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 26,
      key: 'compare-flag',
      parentNode: null,
      name: '输出数据中添加输入数据做对比的标志位',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 27,
      key: 'use-after-deal',
      parentNode: null,
      name: '使用处理后的输入数据',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 28,
      key: 'use-born-area-judge',
      parentNode: null,
      name: '使用新生区域限开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 29,
      key: 'born-area-judge',
      parentNode: null,
      name: '新生区域限制判断：',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'arr', 'arr'],
    },
    {
      id: 30,
      key: 'no-motor-born-area-judge',
      parentNode: null,
      name: '非动力车新生区域判断',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'arr', 'arr'],
    },
    {
      id: 31,
      key: 'special-born',
      parentNode: null,
      name: '特殊类别新生开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 32,
      key: 'angle-to-org',
      parentNode: null,
      name: '每个基站（杆）对应目标预示初始航向角',
      arr: [],
      showType: 'numArr',
      inputType: ['number', 'number'],
    },
    // {
    //   id: 33,
    //   key: 'need-cam-to-stationid',
    //   parentNode: null,
    //   name: '由相机ID获取基站ID开关',
    //   showType: 'switch',
    //   inputType: 'switch',
    // },
    // {
    //   id: 34,
    //   key: 'cam-to-stationid',
    //   parentNode: null,
    //   name: '相机ID和基站ID对应关系',
    //   arr: [],
    //   showType: 'numArr',
    //   inputType: ['number', 'number'],
    // },
    {
      id: 35,
      key: 'match-cam-ids',
      parentNode: null,
      name: '相机ID匹配关系',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'number'],
    },
    {
      id: 36,
      key: 'use-special-match',
      parentNode: null,
      name: '特殊区域的传递匹配开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 37,
      key: 'special-match',
      parentNode: null,
      name: '特殊匹配区域与规则',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'arr'],
    },
    {
      id: 38,
      key: 'special-head-threshold',
      parentNode: null,
      name: '特殊匹配前进方向距离匹配阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 39,
      key: 'special-ano-threshold',
      parentNode: null,
      name: '特殊匹配横向距离匹配阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 40,
      key: 'use-right-fix',
      parentNode: null,
      name: '右转车道结合开关',
      showType: 'switch',
      inputType: 'switch',
    },
    // {
    //   id: 41,
    //   key: 'right-angle-param',
    //   parentNode: null,
    //   name: '右转车道的航向角修正参数',
    //   arr: [],
    //   showType: 'numArr',
    //   inputType: ['arr'],
    // },
    {
      id: 42,
      key: 'm-uc-return-org-data',
      parentNode: null,
      name: '返回原始数据开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 43,
      key: 'm-uc-check-org-data-index',
      parentNode: null,
      name: '返回的ID位值',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 44,
      key: 'target-fix-location',
      parentNode: null,
      name: '依据原心进行位置修正开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 45,
      key: 'target-fix-param',
      parentNode: null,
      name: '位置修正参数',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'arr'],
    },
    {
      id: 46,
      key: 'focus-fix-location',
      parentNode: null,
      name: '强制位置修正开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 47,
      key: 'focus-fix-params',
      parentNode: null,
      name: '强制位置修正参数',
      arr: [],
      showType: 'object',
      inputType: ['arr', 'number'],
    },
    {
      id: 48,
      key: 'curve-fix-location',
      parentNode: null,
      name: '曲线轴位置修正开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 49,
      key: 'curve-fix-params',
      parentNode: null,
      name: '曲线轴修正参数',
      arr: [],
      showType: 'object',
      inputType: ['arr', 'number'],
    },
    {
      id: 50,
      key: 'use-special-nms',
      parentNode: null,
      name: '特殊NMS开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 51,
      key: 'further-dis-nms',
      parentNode: null,
      name: '针对动态车的进一步重要判断开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 52,
      key: 'lane-fitter-sets',
      parentNode: null,
      name: '车道上目标进一步去重开关',
      arr: [],
      showType: 'numArr',
      inputType: ['arr', 'arr'],
    },
    // {
    //   id: 53,
    //   key: 'big-motor-type',
    //   arr: [],
    //   parentNode: null,
    //   name: '大目标类别编码号',
    //   showType: 'text',
    //   inputType: 'text',
    // },
    {
      id: 54,
      key: 'head-dis-thresh-big',
      parentNode: null,
      name: '大目标距离匹配前进方向阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 55,
      key: 'ano-dis-thresh-big',
      parentNode: null,
      name: '大目标距离匹配前进横向阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 56,
      key: 'head-dis-thresh-small',
      parentNode: null,
      name: '小目标距离匹配前进方向阈值',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 57,
      key: 'ano-dis-thresh-small',
      parentNode: null,
      name: '小目标距离匹配前进横向阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 58,
      key: 'further-nomotor-nms',
      parentNode: null,
      name: '非动力车进一步去重开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 59,
      key: 'further-no-dis',
      parentNode: null,
      name: '非动力车进一步去重距离阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 60,
      key: 'subtend-cam-params',
      parentNode: null,
      name: '非动力车进一步去重阈值',
      arr: [],
      showType: 'numArr',
      inputType: ['number', 'arr'],
    },
    {
      id: 61,
      key: 'save-cam-params',
      parentNode: null,
      name: '相机保存目标的区间',
      arr: [],
      showType: 'numArr',
      inputType: ['number', 'arr'],
    },
    {
      id: 62,
      key: 'use-result-nms',
      parentNode: null,
      name: '跟踪结果去重开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 63,
      key: 'use-twin-flag',
      parentNode: null,
      name: '跨生后处理开关',
      showType: 'switch',
      inputType: 'switch',
    },
    {
      id: 64,
      key: 'sort-max-age',
      parentNode: null,
      name: 'hit帧数少的目标未匹配帧数阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 65,
      key: 'sort-max-low',
      parentNode: null,
      name: '消失目标删除帧数阈值',
      showType: 'input',
      inputType: 'double',
    },
    {
      id: 66,
      key: 'sort-min-hits',
      parentNode: null,
      name: '最小点击中次数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 67,
      key: 'smooth-window',
      parentNode: null,
      name: '平滑窗口大小',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 68,
      key: 'angle-smooth-len',
      parentNode: null,
      name: '角度平滑窗口大小',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 69,
      key: 'xy-smooth-len',
      parentNode: null,
      name: '轨迹平滑窗口大小',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 70,
      key: 'speed-smooth-len',
      parentNode: null,
      name: '速度平滑窗口大小',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 71,
      key: 'off-frames',
      parentNode: null,
      name: '离线缓存帧数',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 72,
      key: 'trunk-labels',
      parentNode: null,
      name: '卡车类别',
      showType: 'input',
      inputType: 'number',
    },
    {
      id: 73,
      key: 'motor-vehicle-labels',
      parentNode: null,
      arr: [],
      name: '机动车类别',
      showType: 'text',
      inputType: 'text',
    },
    {
      id: 74,
      key: 'label-lock-xmin',
      parentNode: null,
      name: '类别锁定区域xmin',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 75,
      key: 'label-lock-xmax',
      parentNode: null,
      name: '类别锁定区域xmax',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 76,
      key: 'label-lock-ymin',
      parentNode: null,
      name: '类别锁定区域ymin',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 77,
      key: 'label-lock-ymax',
      parentNode: null,
      name: '类别锁定区域ymax',
      showType: 'input',
      inputType: 'int',
    },
    {
      id: 78,
      key: 'person-label',
      parentNode: null,
      name: '行人类别',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 79,
      key: 'bicycle-label',
      parentNode: null,
      name: '非机动车类别',
      showType: 'input',
      inputType: 'uint',
    },
    {
      id: 80,
      key: 'track-class',
      arr: [],
      parentNode: null,
      name: '跟踪输出类别',
      showType: 'arrText',
      inputType: ['arrText'],
    },
  ],
}

const data_main4 = [data_1, data_2, data_3]

export const dataProcessing_pre_4 = (params) => {
  if (!params) return
  // 头部的块
  data_main4.forEach((ele) => {
    const data = ele.data
    data.forEach((item) => {
      if (item.arr) {
        item.arr = item.parentNode ? params[item.parentNode][item.key] : params[item.key]
      }
      item.value = item.parentNode ? params[item.parentNode][item.key] : params[item.key]
    })
  })

  return { data_main4 }
}
